package com.loongtech.bi.entity.system;

import com.loongtech.core.gen.GenInnerK;
import com.loongtech.core.jpa.entity.EntityIntAutoWithoutVersion;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "system_role")
@GenInnerK
public class EntitySysRole extends EntityIntAutoWithoutVersion {
	private static final long serialVersionUID = 1L;
	@Column(columnDefinition="varchar(255) NOT NULL default ''")
	private String name;						// 名称
	@Column(columnDefinition="varchar(255)")
	private String description;				// 描述
	private int types = 0;	// 类型


    public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getTypes() {
		return types;
	}

	public void setTypes(int types) {
		this.types = types;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

    private int version = 1;			//乐观锁

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "EntitySysRole{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", types=" + types +
                '}';
    }

    public static class K {
		public static final String name = "name";
		public static final String description = "description";
		public static final String types = "types";
		public static final String id = "id";
		public static final String version = "version";
		
		//name, description, types, id, version, 
		public static java.util.List<String> toList() {
			java.util.List<String> list = new java.util.ArrayList<>();
			list.add(name);
			list.add(description);
			list.add(types);
			list.add(id);
			list.add(version);
			return list;
		}
	}
}